﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Skala.master" AutoEventWireup="true" CodeFile="Cantam.aspx.cs" Inherits="Cantam" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        function UrunSil(UrunId) {
             var hidUrun = '#' + '<%= hidUrunId.ClientID  %>';
             var btnSil = '#' + '<%= btnSil.ClientID  %>';
             $(hidUrun).val(UrunId);
             $(btnSil).trigger("click");
        }

        function HaberVer(UrunId) {
            var hidUrun = '#' + '<%= hidUrunId.ClientID  %>';
            var btnHaberVer = '#' + '<%= btnHaberVer.ClientID  %>';
            $(hidUrun).val(UrunId);
            $(btnHaberVer).trigger("click");
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <div class="sepet-urun-liste-kapsam">
        <asp:Label ID="lblDurum" runat="server"></asp:Label>
    <div>
      <div class="" runat="server" id="divCanta">
        <table class="table table-hover" >
          <thead>
            <tr>
              <th width="20%"><asp:Label ID="lblUrun" runat="server" /></th>
              <th width="14%" class="text-center"><asp:Label ID="lblKampanya" runat="server" /></th>
              <th width="14%" class="text-center"><asp:Label ID="lblSiparisAdedi" runat="server" /></th>
              <th width="14%" class="text-center"><asp:Label ID="lblBirimFiyat" runat="server" /></th>
              <th width="14%" class="text-center"><asp:Label ID="lblToplamFiyat" runat="server" /></th>
              <th width="5%" class="text-right"><asp:Label ID="lblSil" runat="server" /></th>
            </tr>
          </thead>
          <tbody>         
                
            <asp:HiddenField   ID="hidUrunId" runat="server" Value="0" />
            <asp:Button Style="display:none;"  ID="btnHaberVer" runat="server" UseSubmitBehavior="false"  OnClick="btnHaberVer_Click" Text="Button" />
            <asp:Button Style="display:none;"  ID="btnSil" runat="server" UseSubmitBehavior="false"  OnClick="btnSil_Click" Text="Button" />    
            <asp:ListView ID="listCanta" runat="server" DataSourceID="dsCantam" OnDataBound="listCanta_DataBound" >
            <ItemTemplate >          
            <tr>
              <td class="col-md-4"><div class="media"> <a class="thumbnail pull-left" href='UrunDetay.aspx?UrunId=<%# Eval( "UrunId") %>'><img src='urunler/<%# Eval( "kucukResimAdi") %>' alt="" width="80" height="80"></a>
                  <div class="media-body">
                      <asp:Label ID="lblUrunId" runat="server" Visible="false"  Text='<%#Eval( "UrunId")%>'></asp:Label>
                    <h4 class="media-heading"><a href='<%# Page.GetRouteUrl("Urun",new {UrunId = Eval( "UrunId"),UrunAdi=Temizle.UrlCevir(Eval( "UrunAdi").ToString()) }) %>'><%#Eval( "UrunAdi")%></a></h4>
                    <h5 class="media-heading"><span class='<%# Eval( "StokClass") %>'><%# Eval( "StokBaslik") %><strong><%# Eval( "StokDurumu") %></strong></span></span> <br>
                      <li class="sepet-urun-stok-kontrol" style="display:<%#Eval( "StokUyariClass")%>"><a href="#" onclick="HaberVer('<%#Eval( "UrunId")%>');"><%#Eval("HaberText")%></a></li>
                    </h5>
                  </div>
                </div></td>
              <td class="col-md-1 text-center"><%#Eval( "KampanyaAdi")%></td>
              <td class="col-md-1 text-center">
                  <asp:TextBox ID="txtAdet" runat="server"  onkeypress="return SadeceRakam(event,['-']);" Enabled='<%# Eval( "AdetDisplay").ToString().Trim() == "true" %>' Text='<%# Eval( "Adet") %>' TextMode="Number" AutoPostBack="true" Width="45" OnTextChanged="txtAdet_TextChanged"  ></asp:TextBox>
                  <asp:Label ID="lblStokMiktari" runat="server"  Text='<%#Eval( "StokMiktari")%>' style="display:none"></asp:Label>
              </td>
              <td class="col-md-1 text-center"><div class="urun-fiyat-eski" style="display:<%#Eval( "IndirimsizFiyatClass")%>"><strong><%#Eval( "ParaBirimiGenel")%></strong><%#Eval( "IndirimsizFiyat")%></div>
                <strong><%#Eval( "Fiyat")%> <%#Eval( "ParaBirimiGenel")%> </strong></td>
              <td class="col-md-1 text-center"><strong><%#Eval( "ToplamFiyat")%> <%#Eval( "ParaBirimi")%> </strong></td>
              <td class="col-md-1 sepet-saga-yasla"><button class="btn btn-danger btn-xs" onclick="UrunSil('<%#Eval( "UrunId")%>');" data-title="Delete" data-toggle="modal" data-target="#delete" data-placement="top" rel="tooltip"><span class="glyphicon glyphicon-trash"></span></button></td>
            </tr>            
            </ItemTemplate>
            </asp:ListView>

            <%--<tr runat="server" id="trParaPuan">
              <td class="text-right" >&nbsp;</td>
              <td class="text-right"><span >Para Puan : </span></td>
              <td ><span> </span></td>
              <td ><asp:CheckBox runat="server" ID="cbParaPuan" Text="Kullan" /> </td>
              <td >&nbsp;</td>
              <td >&nbsp;</td>
            </tr>
            <tr>
              <td></td>
              <td class="text-right">İndirim Kodu : </td>
              <td ><div class="span3">
                  <asp:TextBox runat="server" ID="txtIndirim"  class="input-block-level" autocomplete="off" />
              </div></td>
              <td colspan="2" ><button type="submit" class="btn btn-foursquare dugme-indirim-kodu-kullan">Kullan</button><span class="btn btn-danger btn-xs" style="margin: 1px 0 0 5px; display:none">Girdiğiniz kod hatalı</span></td>
              <td >&nbsp;</td>
            </tr>--%>
            <tr>
              <td colspan="6" style="border-bottom:none;" ><div class="sepet-fiyat-bilgileri">
                  <ul>
                    <li>
                      <asp:Label ID="lblAraToplamHeader" runat="server" />
                      <strong>:</strong> <span><asp:Label ID="lblAraToplam" runat="server" Text=""></asp:Label></span></li>
                    <%--<li>
                      <label>Kargo Bedeli</label>
                      <strong>:</strong> <span></span></li>
                    <li>
                      <label>Toplam İndirim  Tutarı </label>
                      <strong>: </strong> <span></span></li>--%>
                      <li>
                      <asp:Label ID="lblToplamTutarHeader" runat="server" />
                      <strong>:</strong> <span> <asp:Label ID="lblToplam" runat="server" Text=""></asp:Label></span></li>
                      <li>
                      <asp:Label ID="lblTLToplamHeader" runat="server" />
                      <strong>:</strong> <span> <asp:Label ID="lblToplamTL" runat="server" Text=""></asp:Label></span></li></ul></div></td>
            </tr>
            <tr>
              <td colspan="4" style="border:none">       </td>
              <td style="border:none"></td>
              <td style="border:none"><asp:Button runat="server" ID="btnSiparis" type="button" class="btn dugme-siparis-ver" OnClick="btnSiparis_Click"/></td>
            </tr>
            <tr>
              <td colspan="4">&nbsp;</td>
              <td></td>
              <td>&nbsp;</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="dsCantam" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetCantam" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:SessionParameter DefaultValue="-1" Name="UyeId" SessionField="UyeId" Type="Int32" />
    <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
    </SelectParameters>
</asp:SqlDataSource>


    <%--<div id="urunler" >
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <table style="width:1024px">
            <tr>
                <td>Resim</td>
                <td>Ürün</td>
                <td>Kampanya</td>
                <td>Birim Fiyat</td>
                <td>Toplam Fiyat</td>
                <td style="display:none">Stok Miktarı</td>
                <td>Sipariş Adedi</td>
                <td>Sil</td>
            </tr>
    <asp:ListView ID="listCanta" runat="server" DataSourceID="dsCantam" OnDataBound="listCanta_DataBound" >
        <ItemTemplate >
            <tr>
            <li style="list-style-type:none;margin: 10px 0 0 8px; padding:1px 0 0 1px;text-align:left">
                <td><a href='UrunDetay.aspx?UrunId=<%# Eval( "UrunId") %>'><img src='urunler/<%# Eval( "kucukResimAdi") %>' width="50" height="50" /> </a></td>
                <td><p style="text-align:center;line-height:1px"><a href='UrunDetay.aspx?UrunId=<%# Eval( "UrunId") %>'><%#Eval( "UrunAdi")%></a></p></td>
                <td><p style="text-align:center;line-height:1px"><%#Eval( "KampanyaAdi")%></p></td>
                <td><p style="text-align:center;line-height:1px"><%#Eval( "Fiyat")%> </p></td>
                <td><asp:Label ID="lblToplamFiyat" runat="server" ><%#Eval( "ToplamFiyat")%> </asp:Label></td>
                <td  style="display:none"><asp:Label ID="lblStokMiktari" runat="server"  Text='<%#Eval( "StokMiktari")%>'></asp:Label></td>                
                <td><asp:TextBox ID="txtAdet" runat="server" Text='<%# Eval( "Adet") %>' TextMode="Number" AutoPostBack="true" Width="30" OnTextChanged="txtAdet_TextChanged"></asp:TextBox>
                    <asp:Label ID="lblUrunId" runat="server" Visible="false"  Text='<%#Eval( "UrunId")%>'></asp:Label>
                </td>
                <td><asp:Button ID="btnSil" runat="server"  Text="Sil" OnClick="btnSil_Click"></asp:Button></td>                
                </li>
                </tr>
                </ItemTemplate>
            </asp:ListView>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>Genel Toplam</td>
                <td><asp:Label ID="lblGenelFiyat" runat="server" Text="Label"></asp:Label></td>
                <td style="display:none"></td>
                <td><asp:Label ID="lblToplamAdet" runat="server" Text="Label"></asp:Label></td>
                <td></td>
            </tr>
            </table>
        </ContentTemplate>
</asp:UpdatePanel>
</div>
<div><asp:Button ID="btnSiparis" runat="server"  Text="Sipariş Oluştur" PostBackUrl="~/Siparis.aspx" /> </div>--%>
    
     </asp:Content>

